﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Librerias.CAD
{
    public class CADPuntos
    {
        public void MasUno(string url, string correo)
        {
            SqlConnection con = new SqlConnection(CADConexion.connString);
            try
            {

                con.Open();

                new SqlCommand("insert into puntos (punUrl, punCorreo, punPuntos) "+
                    "values('" + url + "','" + correo + "', 1 );", con).ExecuteNonQuery();

            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }

        public void MenosUno(string url, string correo)
        {
            SqlConnection con = new SqlConnection(CADConexion.connString);
            try
            {

                con.Open();

                new SqlCommand("insert into puntos (punUrl, punCorreo, punPuntos) " +
                    "values('" + url + "','" + correo + "', -1 );", con).ExecuteNonQuery();

            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }
    }
}
